<template>
  <view class="page">
    <view @tap="address" class="empty">
      <view class="empty__inn">
        <image class="empty__icon" src="~@/static/my/addressIcon.png" />
        <text>请填写地址信息</text>
      </view>
    </view>
    <view @tap="address" class="block">
      <image class="block__icon" src="~@/static/my/addressIcon.png" />
      <view class="yd-flex-v yd-flex-1">
        <text>雷成（<text class="yellow">18718645212</text>）</text>
        <text class="text gray">广东省广州市天河区黄埔大中100号</text>
      </view>
      <image class="block__arrow" src="~@/static/my/arrow.png" />
    </view>
    <view class="goods-box">
      <view class="items">
        <Goods />
        <Goods />
      </view>
      <view class="line">
        <view class="l" />
      </view>
      <view class="row">
        <text>商品总价</text>
        <text>￥49.00</text>
      </view>
      <view class="row">
        <text>运费</text>
        <text>￥10.00</text>
      </view>
      <view class="total">
        <text>实付款</text>
        <text class="red">￥59.00</text>
      </view>
    </view>
    <view @tap="submit" class="global-btn">提交订单</view>
  </view>
</template>

<script>
import Goods from '@/components/Goods/Goods.vue';

export default {
  components: { Goods },
  methods: {
    address() {
      uni.navigateTo({
        url: '/subpages/my/address/create'
      })
    },
    submit() {
      uni.navigateTo({
        url: '/subpages/shop/pay/pay'
      })
    }
  }
}
</script>

<style lang="scss">
.page {
  box-sizing: border-box;
  padding: 24rpx;
}
.empty {
  background-color: #fff;
  border-radius: 14rpx;
  margin-bottom: 20rpx;
  box-sizing: border-box;
  padding: 20rpx;
}
.empty__inn {
  border: 2rpx dashed #EEEEEE;
  border-radius: 12rpx;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #666;
  font-size: 26rpx;
  box-sizing: border-box;
  padding: 16rpx 0;
}
.empty__icon {
  width: 64rpx;
  height: 64rpx;
  margin-right: 4rpx;
}
.goods-box {
  background-color: #fff;
  border-radius: 14rpx;
  overflow: hidden;
  margin-bottom: 24rpx;
  .items {
    box-sizing: border-box;
    padding: 20rpx 20rpx 0 20rpx;
    font-size: 24rpx;
    color: #333;
    .tip {
      color: #999;
    }
  }
  .line {
    width: 100%;
    height: 24rpx;
    display: flex;
    align-items: center;
    margin-bottom: 24rpx;
    position: relative;
    .l {
      flex: 1;
      border-top: 4rpx dashed #D1D1D1;
      margin-top: 2rpx;
    }
    &::before{
      content: '';
      display: block;
      width: 24rpx;
      height: 24rpx;
      background-color: #F4F5F8;
      position: absolute;
      border-radius: 50%;
      top: 0;
      left: -12rpx;
    }
    &::after{
      content: '';
      display: block;
      width: 24rpx;
      height: 24rpx;
      background-color: #F4F5F8;
      border-radius: 50%;
      position: absolute;
      top: 0;
      right: -12rpx;
    }
  }
  .row {
    box-sizing: border-box;
    padding: 0 24rpx;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 24rpx;
    color: #999;
    margin-top: 12rpx;
    &:last-child {
      margin-bottom: 20rpx;
    }
  }
  .total {
    margin-top: 24rpx;
    box-sizing: border-box;
    padding: 20rpx 24rpx;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 2rpx solid #E4E4E4;
    color: #333;
    font-size: 24rpx;
    .red {
      color: #EB1C1C;
      font-size: 28rpx;
      font-weight: bold;
    }
  }
}
.block {
  background-color: #fff;
  border-radius: 14rpx;
  color: #333333;
  font-size: 30rpx;
  box-sizing: border-box;
  padding: 24rpx 0 24rpx 24rpx;
  display: flex;
  align-items: center;
  margin-bottom: 24rpx;
  font-weight: bold;
  .text {
    font-size: 24rpx;
    margin-top: 12rpx;
    font-weight: 400;
    line-height: 1.3;
  }
  .gray {
    color: #666;
  }
  .yellow {
    color: #FBBF0D;
  }
}
.block__icon {
  min-width: 80rpx;
  width: 80rpx;
  height: 80rpx;
  margin-right: 20rpx;
}
.block__arrow {
  min-width: 88rpx;
  width: 88rpx;
  height: 88rpx;
}
</style>
